using System;
using System.Collections.Generic;
using System.Threading;
using System.Diagnostics;
using System.Reflection;
using Dff;
using SwModem.Com;
using SwModem.Fsk;
using System.Windows.Forms;


namespace SwModem
{
    /// <summary>
    /// Builds the graph. This class will be part of DF Framework and will construct the graph from
    /// its XML representation (TODO)
    /// </summary>
    public static class Builder
    {
        const int SampleFreq = 44100;
        const int SampleBits = 16;
        const int BufferSize = 128;
        
        /// <summary>
        /// Builds the graph
        /// </summary>
        public static void Build()
        {
            //// graph edges to construct the dsp graph
            //NodeEdge<byte>   a1 = new NodeEdge<byte>  (BufferSize);
            //NodeEdge<byte>   a2 = new NodeEdge<byte>  (BufferSize);
            //NodeEdge<double> b1 = new NodeEdge<double>(500000);

            //// graph nodes
            //// * I have COM8 in my PC after installing com0com serial port emulator software, I test 
            //// this software with HyperTerminal/PuTTY connected to COM6. Run com0com setup utility
            //V21         modem = new V21();
            //TtyPortNode ttysx = new TtyPortNode("COM8", 9600); //*
            //WavFileNode wavef = new WavFileNode(IOType.I, "Output " + 
            //    DateTime.Now.ToString().Replace(':', '_').Replace('/', '_') + ".wav");

            //// let's build the graph
            //a1.AddPort(ttysx.PortO);
            //a1.AddPort(modem.PortIDATA);

            //a2.AddPort(modem.PortODATA);
            //a2.AddPort(ttysx.PortI);

            //// loopback in modem (null analog front-end) with copy of the output signal to a 
            //// *.wav file. This requires a FlexEdge edge type because there are two I ports: 
            //// modem and the wav file node
            //b1.AddPort(modem.PortOWAVE);            
            //b1.AddPort(wavef.Port);
        }
    }
}
